﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace BDS3M.Admin
{
    public partial class Index : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["Account_ID"] == null)
                Response.Redirect("~/Admin/Login.aspx");
            if (Request.QueryString["panel"] != null)
            {
                int id = Convert.ToInt32(Request.QueryString["panel"]);
                int sub = Convert.ToInt32(Request.QueryString["sub"]);
                if (id == 0)
                {
                    
                    if (sub == 1)
                    {
                        BDS3M.Admin.Controls.ListAccount gp = (BDS3M.Admin.Controls.ListAccount)LoadControl("~/Admin/Controls/ListAccount.ascx");

                        mycontent.Controls.Add(gp);
                    }
                    if (sub == 2)
                    {
                        BDS3M.Admin.Controls.ViewProfile gp = (BDS3M.Admin.Controls.ViewProfile)LoadControl("~/Admin/Controls/ViewProfile.ascx");

                        mycontent.Controls.Add(gp);
                    }
                    if (sub == 3)
                    {
                        BDS3M.Admin.Controls.EditProfile gp = (BDS3M.Admin.Controls.EditProfile)LoadControl("~/Admin/Controls/EditProfile.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 4)
                    {
                        BDS3M.Admin.Controls.AddNewAccount gp = (BDS3M.Admin.Controls.AddNewAccount)LoadControl("~/Admin/Controls/AddNewAccount.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 6)
                    {
                        BDS3M.Admin.Controls.EditProfileLogin gp = (BDS3M.Admin.Controls.EditProfileLogin)LoadControl("~/Admin/Controls/EditProfileLogin.ascx");

                        mycontent.Controls.Add(gp);
                    }
                    if (sub == 7)
                    {
                        BDS3M.Admin.Controls.ViewEditProfileLogin gp = (BDS3M.Admin.Controls.ViewEditProfileLogin)LoadControl("~/Admin/Controls/ViewEditProfileLogin.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 8)
                    {
                        BDS3M.Admin.Controls.ChangePass gp = (BDS3M.Admin.Controls.ChangePass)LoadControl("~/Admin/Controls/ChangePass.ascx");

                        mycontent.Controls.Add(gp);
                    }

                }

                if (id == 1)
                {
                    if (sub == 0)
                    {
                        BDS3M.Admin.Controls.ListDonVi gp = (BDS3M.Admin.Controls.ListDonVi)LoadControl("~/Admin/Controls/ListDonVi.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 1)
                    {
                        BDS3M.Admin.Controls.AddDonVi gp = (BDS3M.Admin.Controls.AddDonVi)LoadControl("~/Admin/Controls/AddDonVi.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 2)
                    {
                        BDS3M.Admin.Controls.ListDienTich gp = (BDS3M.Admin.Controls.ListDienTich)LoadControl("~/Admin/Controls/ListDienTich.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 3)
                    {
                        BDS3M.Admin.Controls.AddDienTich gp = (BDS3M.Admin.Controls.AddDienTich)LoadControl("~/Admin/Controls/AddDienTich.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 4)
                    {
                        BDS3M.Admin.Controls.ListTienIch gp = (BDS3M.Admin.Controls.ListTienIch)LoadControl("~/Admin/Controls/ListTienIch.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 5)
                    {
                        BDS3M.Admin.Controls.EditTienIch gp = (BDS3M.Admin.Controls.EditTienIch)LoadControl("~/Admin/Controls/EditTienIch.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 6)
                    {
                        BDS3M.Admin.Controls.AddTienIch gp = (BDS3M.Admin.Controls.AddTienIch)LoadControl("~/Admin/Controls/AddTienIch.ascx");

                        mycontent.Controls.Add(gp);
                    }


                    if (sub == 7)
                    {
                        BDS3M.Admin.Controls.ListSanGiaoDich gp = (BDS3M.Admin.Controls.ListSanGiaoDich)LoadControl("~/Admin/Controls/ListSanGiaoDich.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 8)
                    {
                        BDS3M.Admin.Controls.ViewSanGiaoDich gp = (BDS3M.Admin.Controls.ViewSanGiaoDich)LoadControl("~/Admin/Controls/ViewSanGiaoDich.ascx");

                        mycontent.Controls.Add(gp);
                    }


                    if (sub == 9)
                    {
                        BDS3M.Admin.Controls.ListTinhThanhPho gp = (BDS3M.Admin.Controls.ListTinhThanhPho)LoadControl("~/Admin/Controls/ListTinhThanhPho.ascx");

                        mycontent.Controls.Add(gp);
                    }


                    if (sub == 10)
                    {
                        BDS3M.Admin.Controls.EditTinhThanhPho gp = (BDS3M.Admin.Controls.EditTinhThanhPho)LoadControl("~/Admin/Controls/EditTinhThanhPho.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 11)
                    {
                        BDS3M.Admin.Controls.AddTinhThanhPho gp = (BDS3M.Admin.Controls.AddTinhThanhPho)LoadControl("~/Admin/Controls/AddTinhThanhPho.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 12)
                    {
                        BDS3M.Admin.Controls.ListQuanHuyen gp = (BDS3M.Admin.Controls.ListQuanHuyen)LoadControl("~/Admin/Controls/ListQuanHuyen.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 13)
                    {
                        BDS3M.Admin.Controls.EditQuanHuyen gp = (BDS3M.Admin.Controls.EditQuanHuyen)LoadControl("~/Admin/Controls/EditQuanHuyen.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 14)
                    {
                        BDS3M.Admin.Controls.AddQuanHuyen gp = (BDS3M.Admin.Controls.AddQuanHuyen)LoadControl("~/Admin/Controls/AddQuanHuyen.ascx");

                        mycontent.Controls.Add(gp);
                    }

                }

                if (id == 2)
                {
                    if (sub == 0)
                    {
                        BDS3M.Admin.Controls.AddMenuTop gp = (BDS3M.Admin.Controls.AddMenuTop)LoadControl("~/Admin/Controls/AddMenuTop.ascx");

                        mycontent.Controls.Add(gp);
                    }
                    if (sub == 1)
                    {
                        BDS3M.Admin.Controls.ListMenuTop gp = (BDS3M.Admin.Controls.ListMenuTop)LoadControl("~/Admin/Controls/ListMenuTop.ascx");

                        mycontent.Controls.Add(gp);
                    }
                    if (sub == 2)
                    {
                        BDS3M.Admin.Controls.EditMenuTop gp = (BDS3M.Admin.Controls.EditMenuTop)LoadControl("~/Admin/Controls/EditMenuTop.ascx");

                        mycontent.Controls.Add(gp);
                    }

                }

                if (id == 3)
                {
                    if (sub == 1)
                    {
                        BDS3M.Admin.Controls.ListNews gp = (BDS3M.Admin.Controls.ListNews)LoadControl("~/Admin/Controls/ListNews.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 2)
                    {
                        BDS3M.Admin.Controls.EditNews gp = (BDS3M.Admin.Controls.EditNews)LoadControl("~/Admin/Controls/EditNews.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 3)
                    {
                        BDS3M.Admin.Controls.AddNews gp = (BDS3M.Admin.Controls.AddNews)LoadControl("~/Admin/Controls/AddNews.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 4)
                    {
                        BDS3M.Admin.Controls.ViewDetailNews gp = (BDS3M.Admin.Controls.ViewDetailNews)LoadControl("~/Admin/Controls/ViewDetailNews.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 16)
                    {
                        BDS3M.Admin.Controls.ListRecruitment gp = (BDS3M.Admin.Controls.ListRecruitment)LoadControl("~/Admin/Controls/ListRecruitment.ascx");

                        mycontent.Controls.Add(gp);
                    }
                    if (sub == 17)
                    {
                        BDS3M.Admin.Controls.EditRecruitment gp = (BDS3M.Admin.Controls.EditRecruitment)LoadControl("~/Admin/Controls/EditRecruitment.ascx");

                        mycontent.Controls.Add(gp);
                    }
                    if (sub == 18)
                    {
                        BDS3M.Admin.Controls.ViewRecruitment gp = (BDS3M.Admin.Controls.ViewRecruitment)LoadControl("~/Admin/Controls/ViewRecruitment.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 19)
                    {
                        BDS3M.Admin.Controls.AddRecruitment gp = (BDS3M.Admin.Controls.AddRecruitment)LoadControl("~/Admin/Controls/AddRecruitment.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 20)
                    {
                        BDS3M.Admin.Controls.ListPhongThuy gp = (BDS3M.Admin.Controls.ListPhongThuy)LoadControl("~/Admin/Controls/ListPhongThuy.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 21)
                    {
                        BDS3M.Admin.Controls.EditPhongThuy gp = (BDS3M.Admin.Controls.EditPhongThuy)LoadControl("~/Admin/Controls/EditPhongThuy.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 22)
                    {
                        BDS3M.Admin.Controls.ViewPhongThuy gp = (BDS3M.Admin.Controls.ViewPhongThuy)LoadControl("~/Admin/Controls/ViewPhongThuy.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 23)
                    {
                        BDS3M.Admin.Controls.AddPhongThuy gp = (BDS3M.Admin.Controls.AddPhongThuy)LoadControl("~/Admin/Controls/AddPhongThuy.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 26)
                    {
                        BDS3M.Admin.Controls.ListPhapLuat gp = (BDS3M.Admin.Controls.ListPhapLuat)LoadControl("~/Admin/Controls/ListPhapLuat.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 27)
                    {
                        BDS3M.Admin.Controls.EditPhapLuat gp = (BDS3M.Admin.Controls.EditPhapLuat)LoadControl("~/Admin/Controls/EditPhapLuat.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 28)
                    {
                        BDS3M.Admin.Controls.ViewPhapLuat gp = (BDS3M.Admin.Controls.ViewPhapLuat)LoadControl("~/Admin/Controls/ViewPhapLuat.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 29)
                    {
                        BDS3M.Admin.Controls.AddPhapLuat gp = (BDS3M.Admin.Controls.AddPhapLuat)LoadControl("~/Admin/Controls/AddPhapLuat.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 30)
                    {
                        BDS3M.Admin.Controls.ListDuAn gp = (BDS3M.Admin.Controls.ListDuAn)LoadControl("~/Admin/Controls/ListDuAn.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 31)
                    {
                        BDS3M.Admin.Controls.EditDuAn gp = (BDS3M.Admin.Controls.EditDuAn)LoadControl("~/Admin/Controls/EditDuAn.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 32)
                    {
                        BDS3M.Admin.Controls.ViewDuAn gp = (BDS3M.Admin.Controls.ViewDuAn)LoadControl("~/Admin/Controls/ViewDuAn.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 33)
                    {
                        BDS3M.Admin.Controls.AddDuAn gp = (BDS3M.Admin.Controls.AddDuAn)LoadControl("~/Admin/Controls/AddDuAn.ascx");

                        mycontent.Controls.Add(gp);
                    }

                }

                if (id == 5)
                {
                    if (sub == 0)
                    {
                        BDS3M.Admin.Controls.ListSlideShow gp = (BDS3M.Admin.Controls.ListSlideShow)LoadControl("~/Admin/Controls/ListSlideShow.ascx");

                        mycontent.Controls.Add(gp);
                    }
                    if (sub == 1)
                    {
                        BDS3M.Admin.Controls.EditSlideShow gp = (BDS3M.Admin.Controls.EditSlideShow)LoadControl("~/Admin/Controls/EditSlideShow.ascx");

                        mycontent.Controls.Add(gp);
                    }
                    if (sub == 3)
                    {
                        BDS3M.Admin.Controls.AddSlideShow gp = (BDS3M.Admin.Controls.AddSlideShow)LoadControl("~/Admin/Controls/AddSlideShow.ascx");

                        mycontent.Controls.Add(gp);
                    }
                    if (sub == 4)
                    {
                        BDS3M.Admin.Controls.ListPoster gp = (BDS3M.Admin.Controls.ListPoster)LoadControl("~/Admin/Controls/ListPoster.ascx");

                        mycontent.Controls.Add(gp);
                    }
                    if (sub == 5)
                    {
                        BDS3M.Admin.Controls.EditPoster gp = (BDS3M.Admin.Controls.EditPoster)LoadControl("~/Admin/Controls/EditPoster.ascx");

                        mycontent.Controls.Add(gp);
                    }
                    if (sub == 6)
                    {
                        BDS3M.Admin.Controls.AddPoster gp = (BDS3M.Admin.Controls.AddPoster)LoadControl("~/Admin/Controls/AddPoster.ascx");

                        mycontent.Controls.Add(gp);
                    }


                    if (sub == 7)
                    {
                        BDS3M.Admin.Controls.ListVideo gp = (BDS3M.Admin.Controls.ListVideo)LoadControl("~/Admin/Controls/ListVideo.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 8)
                    {
                        BDS3M.Admin.Controls.EditVideo gp = (BDS3M.Admin.Controls.EditVideo)LoadControl("~/Admin/Controls/EditVideo.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 9)
                    {
                        BDS3M.Admin.Controls.ListCategoryImage gp = (BDS3M.Admin.Controls.ListCategoryImage)LoadControl("~/Admin/Controls/ListCategoryImage.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 10)
                    {
                        BDS3M.Admin.Controls.EditCategoryImage gp = (BDS3M.Admin.Controls.EditCategoryImage)LoadControl("~/Admin/Controls/EditCategoryImage.ascx");

                        mycontent.Controls.Add(gp);
                    }
                    if (sub == 11)
                    {
                        BDS3M.Admin.Controls.AddCategoryImage gp = (BDS3M.Admin.Controls.AddCategoryImage)LoadControl("~/Admin/Controls/AddCategoryImage.ascx");

                        mycontent.Controls.Add(gp);
                    }
                    if (sub == 12)
                    {
                        BDS3M.Admin.Controls.ListLibraryImage gp = (BDS3M.Admin.Controls.ListLibraryImage)LoadControl("~/Admin/Controls/ListLibraryImage.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 13)
                    {
                        BDS3M.Admin.Controls.EditLibraryImage gp = (BDS3M.Admin.Controls.EditLibraryImage)LoadControl("~/Admin/Controls/EditLibraryImage.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 14)
                    {
                        BDS3M.Admin.Controls.AddLibraryImage gp = (BDS3M.Admin.Controls.AddLibraryImage)LoadControl("~/Admin/Controls/AddLibraryImage.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 15)
                    {
                        BDS3M.Admin.Controls.ListCompanyInfo gp = (BDS3M.Admin.Controls.ListCompanyInfo)LoadControl("~/Admin/Controls/ListCompanyInfo.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 16)
                    {
                        BDS3M.Admin.Controls.EditCompanyInfo gp = (BDS3M.Admin.Controls.EditCompanyInfo)LoadControl("~/Admin/Controls/EditCompanyInfo.ascx");

                        mycontent.Controls.Add(gp);
                    }
                }
                if (id == 6)
                {
                    if (sub == 0)
                    {
                        BDS3M.Admin.Controls.Chart gp = (BDS3M.Admin.Controls.Chart)LoadControl("~/Admin/Controls/Chart.ascx");

                        mycontent.Controls.Add(gp);
                    }
                    if (sub == 1)
                    {
                        BDS3M.Admin.Controls.ListNote gp = (BDS3M.Admin.Controls.ListNote)LoadControl("~/Admin/Controls/ListNote.ascx");

                        mycontent.Controls.Add(gp);
                    }
                    if (sub == 2)
                    {
                        BDS3M.Admin.Controls.Notification gp = (BDS3M.Admin.Controls.Notification)LoadControl("~/Admin/Controls/Notification.ascx");

                        mycontent.Controls.Add(gp);
                    }

                }
                if (id == 7)
                {
                    if (sub == 0)
                    {
                        BDS3M.Admin.Controls.ListLogo gp = (BDS3M.Admin.Controls.ListLogo)LoadControl("~/Admin/Controls/ListLogo.ascx");

                        mycontent.Controls.Add(gp);
                    }
                    if (sub == 1)
                    {
                        BDS3M.Admin.Controls.EditLogo gp = (BDS3M.Admin.Controls.EditLogo)LoadControl("~/Admin/Controls/EditLogo.ascx");

                        mycontent.Controls.Add(gp);
                    }
                    if (sub == 2)
                    {
                        BDS3M.Admin.Controls.ListHelpOnline gp = (BDS3M.Admin.Controls.ListHelpOnline)LoadControl("~/Admin/Controls/ListHelpOnline.ascx");

                        mycontent.Controls.Add(gp);
                    }
                    if (sub == 3)
                    {
                        BDS3M.Admin.Controls.AddYahooOnline gp = (BDS3M.Admin.Controls.AddYahooOnline)LoadControl("~/Admin/Controls/AddYahooOnline.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 26)
                    {
                        BDS3M.Admin.Controls.EditHelpOnline gp = (BDS3M.Admin.Controls.EditHelpOnline)LoadControl("~/Admin/Controls/EditHelpOnline.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 4)
                    {
                        BDS3M.Admin.Controls.ListLink gp = (BDS3M.Admin.Controls.ListLink)LoadControl("~/Admin/Controls/ListLink.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 5)
                    {
                        BDS3M.Admin.Controls.AddLink gp = (BDS3M.Admin.Controls.AddLink)LoadControl("~/Admin/Controls/AddLink.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 6)
                    {
                        BDS3M.Admin.Controls.ListContact gp = (BDS3M.Admin.Controls.ListContact)LoadControl("~/Admin/Controls/ListContact.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 7)
                    {
                        BDS3M.Admin.Controls.ViewContact gp = (BDS3M.Admin.Controls.ViewContact)LoadControl("~/Admin/Controls/ViewContact.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 8)
                    {
                        BDS3M.Admin.Controls.ListGoogleMap gp = (BDS3M.Admin.Controls.ListGoogleMap)LoadControl("~/Admin/Controls/ListGoogleMap.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 9)
                    {
                        BDS3M.Admin.Controls.EditGoogleMap gp = (BDS3M.Admin.Controls.EditGoogleMap)LoadControl("~/Admin/Controls/EditGoogleMap.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 14)
                    {
                        BDS3M.Admin.Controls.ListHeader gp = (BDS3M.Admin.Controls.ListHeader)LoadControl("~/Admin/Controls/ListHeader.ascx");

                        mycontent.Controls.Add(gp);
                    }
                    if (sub == 15)
                    {
                        BDS3M.Admin.Controls.EditHeader gp = (BDS3M.Admin.Controls.EditHeader)LoadControl("~/Admin/Controls/EditHeader.ascx");

                        mycontent.Controls.Add(gp);
                    }


                    if (sub == 24)
                    {
                        BDS3M.Admin.Controls.ListHoiDap gp = (BDS3M.Admin.Controls.ListHoiDap)LoadControl("~/Admin/Controls/ListHoiDap.ascx");

                        mycontent.Controls.Add(gp);
                    }

                    if (sub == 25)
                    {
                        BDS3M.Admin.Controls.ViewHoiDap gp = (BDS3M.Admin.Controls.ViewHoiDap)LoadControl("~/Admin/Controls/ViewHoiDap.ascx");

                        mycontent.Controls.Add(gp);
                    }



                }
            }
            else
            {
                BDS3M.Admin.Controls.Main gp = (BDS3M.Admin.Controls.Main)LoadControl("~/Admin/Controls/Main.ascx");

                mycontent.Controls.Add(gp);
            }
        }
    }
}